package cj.web.portal.dao;
/*
 *  
 *  
*/
import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import cj.web.kly.domain.GroupPeople;

/**
 * 
 * @author 
 *
 */
@DAO
public interface GroupPeopleVoDAO{
	
	@SQL("SELECT id,labelId,name,photo FROM GroupPeople WHERE deleteFlag=1 AND labelId=:1 ORDER BY orderNo ")
    List<GroupPeople> queryBylabelId(int labelId);
	
	@SQL("SELECT id,groupId,depId,name,photo FROM GroupPeople WHERE deleteFlag=1 AND depId=:1 ORDER BY orderNo ")
    List<GroupPeople> queryBydepId(int depId);
	
	@SQL("SELECT id,groupId,depId,name,photo FROM GroupPeople WHERE deleteFlag=1 AND depId=:1 AND type=:2 ORDER BY orderNo ")
    List<GroupPeople> queryBydepId(int depId,int type);
	
	@SQL("SELECT id,infor,groupId,labelId,depId,name,photo,honor,jobTitle,political,date(birthdate) as birthdate,address,descs FROM GroupPeople WHERE deleteFlag=1 AND depId=:1 ORDER BY orderNo ")
    List<GroupPeople> queryDetaillis(int depId);
		
    @SQL("SELECT a.*,date(birthdate) as birthdate,b.name as depName,c.name as groupName FROM GroupPeople a left join GroupDep b on a.depId=b.id left join GroupInfor c on a.groupId=c.id WHERE a.id=:1 ")
    GroupPeople queryById(int id);
    
    @SQL("SELECT id,infor,groupId,labelId,depId,name,photo,honor,jobTitle,political,date(birthdate) as birthdate,address,descs FROM GroupPeople WHERE deleteFlag=1 AND depId=:1 ORDER BY orderNo LIMIT :2,:3 ")
    List<GroupPeople> querylis(int depId,int start,int length);
    
    @SQL("SELECT count(1) FROM GroupPeople WHERE deleteFlag=1 AND depId=:1 ")
    int querylisSize(int depId);
}